﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Editor
{
    public class TransparentPanel : Panel
    {

        public TransparentPanel()
        {
            DoubleBuffered = true;
            
        }

        override protected CreateParams CreateParams
        {

            get
            {

                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
                return cp;

            }

        }
        protected void InvalidateEx()
        {
            if (Parent == null)
                return;

            Rectangle rc = new Rectangle(this.Location, this.Size);
            Parent.Invalidate(rc, true);
        }

        override protected void OnPaintBackground(PaintEventArgs e)
        {

            // do nothing

        }
        protected override void OnPaint(PaintEventArgs e)
        {
            
        }
    }
}
